<template>
  <el-dialog
    :model-value="visible"
    title="查看已选"
    :width="600"
    :before-close="handleClose"
  >
    <div>
      {{ selectedData }}
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button
          v-blur
          type="primary"
          @click="handleClose()"
        >
          关闭
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
    selectedData: {
      type: Array,
      default: () => [],
    },
  },
  emits: ['update:visible'],
  setup(props, { emit }) {
    return {
      handleClose: () => {
        emit('update:visible', false);
      },
    };
  },
});
</script>
